import Cookies from 'js-cookie';

// 创建用户缓存变量
const UserIdKey = 'SET_USER_ID';
const TokenKey = 'SET_TOKEN';
const NameKey = 'SET_NAME';
const DescriptionKey = 'SET_DESCRIPTION';
const RoleKey = 'SET_USER_ROLE';
const PermissionKey = 'SET_USER_PERMISSION';
const IsLoginKey = 'SET_IS_LOGIN';

// UserId操作
export function getUserId() {
  return Cookies.get(UserIdKey);
}
export function setUserId(userId) {
  return Cookies.set(UserIdKey, userId);
}
export function removeUserId() {
  return Cookies.remove(UserIdKey);
}
// Token操作
export function getToken() {
  return Cookies.get(TokenKey);
}
export function setToken(token) {
  return Cookies.set(TokenKey, token);
}
export function removeToken() {
  return Cookies.remove(TokenKey);
}
// Name操作
export function getName() {
  return Cookies.get(NameKey);
}
export function setName(name) {
  return Cookies.set(NameKey, name);
}
export function removeName() {
  return Cookies.remove(NameKey);
}
// Description操作
export function getDescription() {
  return Cookies.get(DescriptionKey);
}
export function setDescription(description) {
  return Cookies.set(DescriptionKey, description);
}
export function removeDescription() {
  return Cookies.remove(DescriptionKey);
}
// Role操作
export function getRole() {
  return Cookies.get(RoleKey);
}
export function setRole(role) {
  return Cookies.set(RoleKey, role);
}
export function removeRole() {
  return Cookies.remove(RoleKey);
}
// Permission操作
export function getPermission() {
  return Cookies.get(PermissionKey);
}
export function setPermission(permission) {
  return Cookies.set(PermissionKey, permission);
}
export function removePermission() {
  return Cookies.remove(PermissionKey);
}
// IsLogin操作
export function getIsLogin() {
  return Cookies.get(IsLoginKey);
}
export function setIsLogin(isLogin) {
  return Cookies.set(IsLoginKey, isLogin);
}
export function removeIsLogin() {
  return Cookies.remove(IsLoginKey);
}
